package com.zb.internetSpider.gui.tree;

import java.awt.Color;
import java.awt.Font;
import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.util.List;

import javax.annotation.Resource;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JTree;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeCellRenderer;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreeNode;

import org.springframework.stereotype.Component;

import com.zb.internetSpider.entity.Menu;
import com.zb.internetSpider.gui.SpiderComponent;
import com.zb.internetSpider.gui.SpiderContainer;
import com.zb.internetSpider.gui.mainPanel.AbstractSpiderMainPanel;
import com.zb.internetSpider.gui.tree.listener.SpiderTreeSelectionListener;
import com.zb.internetSpider.gui.tree.utils.TreeUtil;
import com.zb.internetSpider.service.api.MenuService;

/**
 * 菜单树
 * ClassName: SpiderMenuTree 
 * @Description: TODO
 * @author zb
 * @date 2019年2月14日 下午4:15:15
 */
@Component("menuTree")
public class DefaultSpiderMenuTree extends AbstractSpiderTree{
	
//	private DefaultTreeCellRenderer cellRenderer;
//
//	private TreeModel treeModel;
	
	private AbstractSpiderMainPanel spiderContentPanel;
	
	private SpiderTreeSelectionListener selectionListener;
	
	
	
	
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 4362219342283925737L;
	
	
	public DefaultSpiderMenuTree(SpiderTreeSelectionListener selectionListener) {
		// TODO Auto-generated constructor stub
		/**
		 * 设置点击几次关闭或打开菜单
		 */
		this.setToggleClickCount(1);
		
		/**
		 * 添加节点选择监听
		 */
		this.selectionListener = selectionListener;
		
		this.addTreeSelectionListener(this.selectionListener);
	}


	@Override
	public void addTreeModel(SpiderTreeModel spiderTreeModel) {
		// TODO Auto-generated method stub
		super.setModel(spiderTreeModel);
	}


	@Override
	public void addMenuData(List menus) {
		// TODO Auto-generated method stub
		this.menus = menus;
		
	}


	@Override
	public void setSpiderContainers(SpiderContainer... containers) {
		// TODO Auto-generated method stub
		
	}


	@Override
	public void setSpiderComponents(SpiderComponent... components) {
		// TODO Auto-generated method stub
		
	}


	@Override
	public SpiderContainer[] getSpiderContainers() {
		// TODO Auto-generated method stub
		return null;
	}


	@Override
	public SpiderComponent[] getSpiderComponents() {
		// TODO Auto-generated method stub
		return null;
	}


	@Override
	public int SpiderContainersCount() {
		// TODO Auto-generated method stub
		return 0;
	}


	@Override
	public int SpiderComponentsCount() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void addTreeSelectionEvent(SpiderTreeSelectionListener selectionListener) {
		// TODO Auto-generated method stub
			super.addTreeSelectionListener(selectionListener);
	}

}
